/* @(#)GSOrderDetailQueryAction.java   
 *
 * Project: GS
 *
 * Modify Information:
 * =============================================================================
 *   Author       Date       Description
 *   ------------ ---------- ---------------------------------------------------
 *   Jenny Li    2006-2-23     新增
 *
 * Copyright Notice:
 * =============================================================================
 *    Copyright (c) 2001-2006 Beijing HiTRUST Technology Co., Ltd. 1808 Room, 
 *        Science & Technology Building, No. 9 South Street, Zhong Guan Cun, 
 *        Haidian District, Beijing ,100081, China All rights reserved.
 *
 *    This software is the confidential and proprietary information of
 *        Beijing HiTRUST Technology Co., Ltd. ("Confidential Information").
 *        You shall not disclose such Confidential Information and shall use it
 *        only in accordance with the terms of the license agreement you entered
 *        into with HiTRUST.
 *
 * Warning:
 * =============================================================================
 * 
 */
package com.hitrust.gs.action;

import java.util.ArrayList;
import java.util.HashMap;

import com.hitrust.gs.bean.GSManufactureCategoryBean;
import com.hitrust.gs.bean.GSOperatorBean;
import com.hitrust.gs.business.GSManufactureProcessor;
import com.hitrust.gs.business.GSOrderDeptInfoProcessor;
import com.hitrust.gs.business.GSOrgProcessor;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.lib.GSLogWriter;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;
import com.hitrust.gs.util.exception.GSException;

/**
 * 进入巴士物资订单明细查询首页面
 */
public class GSBalanceAuditQueryAction extends GSBaseAction {

    public String execute(GSBaseForm aForm) throws Exception {
        
        GSManufactureProcessor tGSManufProcessor = new GSManufactureProcessor();
        try {
            GSOperatorBean tOperatorBean = (GSOperatorBean) aForm.getSession()
                    .getAttribute(GSBaseConstants.LOGIN);
            // 取得当前操作员可操作企业及下级企业的订货地址
            GSOrderDeptInfoProcessor tOrderDeptInfoProc = new GSOrderDeptInfoProcessor();
            HashMap tMap = tOrderDeptInfoProc
                    .getOrderDeptInfoOfOper(tOperatorBean.getGs_oper_org_id()); 
					 //getOrderDeptInfoOfBusOper ,by sindy 07-08-15
            aForm.getRequest().setAttribute("orderdept", tMap);
            
            //取得订单明细状态
            aForm.getRequest().setAttribute("orderdetailstatuslist", getOrderDetailStatusList());
            
            //取得订单明细状态
            aForm.getRequest().setAttribute("ordertypelist", getOrderTypeList());

            //种类等级
            tGSManufProcessor.getManufactureOfLevel(aForm);
        } catch (GSException e) {
            throw e;
        } catch (Exception e) {
            GSLogWriter.error(this, e.toString());
            throw new GSException("进入产品浏览首页面发生异常");
        }
        return GSBaseConstants.FORWARD_SUCCESS;
    }
    
    /**
     * 取得订单明细状态
     * @return 订单明细状态列表
     */
    private ArrayList getOrderDetailStatusList() {
        ArrayList tResult = new ArrayList();
        
        String [] tArray = new String[2];
        tArray = new String[2];
        tArray[0] = "12";
        tArray[1] = "交货确认";
        tResult.add(tArray);
        
                
        return tResult;
    }
    
    private ArrayList getOrderTypeList() {
        ArrayList tResult = new ArrayList();
        String [] tArray = new String[2];
        tArray[0] = "0";
        tArray[1] = "正常采购";
        tResult.add(tArray);
        
        tArray = new String[2];
        tArray[0] = "1";
        tArray[1] = "应急采购";
        tResult.add(tArray);
                
        return tResult;
    }

}
